num=600851475143
i=1
while i<=num:
    if num%i==0:
        num=num/i
        answer=i
    i+=1
print answer
